package com.wxzz.elearing.evaluation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxzz.elearing.evaluation.entity.BusinessCategoryRuleGroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface BusinessCategoryRuleGroupMapper extends BaseMapper<BusinessCategoryRuleGroup> {

    @Select("SELECT\n" +
            "\tcount( 1 ) \n" +
            "FROM\n" +
            "\t(\n" +
            "SELECT\n" +
            "\tCOUNT(1)\n" +
            "FROM\n" +
            "\tbusiness_category_rule_history \n" +
            "WHERE\n" +
            "\tenterprise_id = #{enterpriseId} AND business_category_rule_id = #{businessCategoryRuleId} AND deleted = 0 \n" +
            "\tAND type = #{type}\n" +
            "\tGROUP BY wx_user_id) business_category_rule_history")
    Integer selectBusinessCategoryRuleGroupPerson(@Param("businessCategoryRuleId") Long businessCategoryRuleId,@Param("enterpriseId") Long enterpriseId, @Param("type") Integer type);
}
